<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use App\Models\User;
class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email',100)->unique();
            $table->string('password')->nullable();
            $table->string('realname')->nullable();
            $table->string('openid')->nullable();
            $table->integer('status')->default(1)->nullable()->comment("1[启用]2[禁用]");;
            $table->integer('sex')->default(1)->nullable()->comment("性别1[男] 2[女]");;
            $table->string('mobile')->nullable()->comment("手机号");;
            $table->rememberToken();
            $table->timestamps();
        });
        DB::table("users")->insert(["name"=>"admin","email"=>"admin","realname"=>"关旭","password"=>Hash::make(123456)]);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
